package controllers

import (
	"database/sql"
	"github.com/kataras/iris/v12"
	"github.com/kataras/iris/v12/mvc"
)


type IBController interface {
	InitController(app *iris.Application,db *sql.DB, routePath string)
	RegisterService()
	RegisterController(controller IBController)
}


type BaseController struct {
	Ctx *iris.Context
	Db *sql.DB
	MvcApp *mvc.Application
}

func (b *BaseController) InitController(app *iris.Application,db *sql.DB, routePath string) {
	b.MvcApp = mvc.New(app.Party(routePath))
}

func (b *BaseController) RegisterService() {

}

func (b *BaseController) RegisterController(controller IBController) {
	b.MvcApp.Handle(controller)
}



